// 创建路由对象

import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
import Tool from "../views/Tool.vue";
// 路由表
// RouteRecordRaw 路由表每一项的约束
const routes:RouteRecordRaw[]=[
    {
      path:"/",
      redirect:"/tool"
    },
    {
        name:"login",
        path:"/login",
        component:()=>import("../views/LoginPage.vue")
    },
    {
       name:'tool',
       path:"/tool" ,
       component:Tool,
       children:[
        {
          path:"/tool",
          redirect:"/tool/index"
        },
        {
            name:"index",
            path:"index",
            component:()=>import("../views/tool/Index.vue")
        },
        {
            name:"cate",
            path:"cate",
            component:()=>import("../views/tool/Cate.vue")
        },
        {
            name:"car",
            path:"car",
            component:()=>import("../views/tool/Car.vue")
        },
        {
            name:"my",
            path:"my",
            component:()=>import("../views/tool/My.vue")
        },
       ]
    }
]


const router=createRouter({
    history:createWebHashHistory(),
    routes
})

export default router